package com.linzt.candy.wxmp.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.linzt.candy.wxmp.domain.WxMpMenu;
import me.chanjar.weixin.common.bean.menu.WxMenu;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author linzt
 * @Date 2020/12/207:11 下午
 * @Description 微信公众号菜单Mapper
 * @Version 1.0
 */
public interface WxMpMenuMapper extends BaseMapper<WxMpMenu> {

    /**
     * 根据微信ID和Pid查找
     * @param appid
     * @param pid
     * @return
     */
    @Select("select * from tb_wx_mp_menu where app_id=#{appid} and pid=#{pid}")
    List<WxMpMenu> findByAppIdAndPid(@Param("appid") String appid,@Param("pid") String pid);

    /**
     * 根据Appid删除
     * @param appId
     */
    @Delete("delete from tb_wx_mp_menu where app_id=#{appId}")
    void deleteByAppId(@Param("appId") String appId);

}
